from logger import logger

logger.debug("Loaded config module.")

import ConfigParser
from defs import get_filename

class RRcfgparser(ConfigParser.ConfigParser):
	def getlist(self, section, datapiece):
		ret = []
		x = self.get(section, datapiece)
		if x != None and x != "":
			for i in x.split(","):
				ret.append(i.strip())
		else:
			return []
		return ret

parser = RRcfgparser()

parser.read(get_filename("main.cfg"))

extralist = parser.getlist("main", "includes");

for i in extralist:
	parser.read(get_filename(i.strip()))

